﻿using AFanDa.BLL.BLLService;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace AFanDa.Admin.Controllers
{
    public class IndexController : Controller
    {
        AdminService _adminService = null;
        public IndexController()
        {
            _adminService = new AdminService();
        }

        // GET: Index
        public ActionResult Index()
        {
            return View();
        }
        // 添加 桌子页面 （彭思期）
        public ActionResult AddTableHtml()
        {
            return View();
        }
        // 添加 桌子类型页面 (彭思期)
        public ActionResult AddTableTypeHtml() { 
        return View();
        }

        /// <summary>
        /// 获取所有员工
        /// </summary>
        /// <param name="page"></param>
        /// <param name="limit"></param>
        /// <param name="key"></param>
        /// <returns></returns>
        [HttpGet]
        public ActionResult GetAdmins(int page = 1, int limit = 10, string key = "")
        {
            var result = _adminService.GetAdmins(new Dto.Request.AdminRequestDto()
            {
                page = page,
                limit = limit,
                key = key ?? ""
            });

            return Json(result, JsonRequestBehavior.AllowGet);

        }


        



    }
}